package com.mall.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mall.common.domain.PageDTO;
import com.mall.domain.dto.Item2DTO;
import com.mall.domain.dto.ItemDTO;
import com.mall.domain.dto.OrderDetailDTO;
import com.mall.domain.dto.SearchForm;
import com.mall.domain.po.Item;
import com.mall.domain.query.ItemPageQuery;
import com.mall.domain.response.Response;
import org.springframework.web.multipart.MultipartFile;


import java.io.IOException;
import java.util.Collection;
import java.util.List;

public interface ItemService extends IService<Item> {
    boolean selectById(Integer id);

    List<ItemDTO> getItemByIds(Collection<Long> ids);

    Page<Item> pages(Integer pageNo,Integer pageSize,boolean isAsc,String sortBy);

    Response<?> inserts(Item2DTO item) throws IOException;

    boolean updateStatus(Integer id, Integer status);

    void updates(Item item);

    boolean delete(Long id);

    void deDuckStock(List<OrderDetailDTO> items);

    Response<?> categories();

    Response<?> brands();

    IPage<Item> getItemList(SearchForm searchForm, Integer page, Integer size);

    Response<?> batchStatus(List<Long> ids, Integer status);

    Response<?> inserts(String name, Integer price, Integer stock, MultipartFile image, String category, String brand, String spec, Boolean isAD, Integer status) throws IOException;

    PageDTO<ItemDTO> search(ItemPageQuery query);
}
